<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
	content="initial-scale=1, maximum-scale=1, user-scalable=no">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta name="keywords"
	content="Web前端视频教程,大数据视频教程,HTML5视频教程,UI视频教程,PHP视频教程,java视频教程,python基础教程">
<meta name="description"
	content="智游教育在线课程视频,为您提供java,python,HTML5,UI,PHP,大数据等学科经典视频教程在线浏览学习,精细化知识点解析,深入浅出,想学不会都难,智游教育,学习成就梦想！">
 <%@include file="/before/include/style.html"%>
<title>在线公开课-智游教育|java|大数据|HTML5|python|UI|PHP视频教程</title>
</head>

<body class="w100">
	 <jsp:include page="/before/include/header.jsp"></jsp:include>

	<div id="app">
		<!--banner图-->
		<div class="banner" id="images"></div>

		<!--面包屑导航-->
		<div class="container mian-nav" id="navDiv"></div>
		<input type="hidden" id="" value="">
		<div class="classify">
			<div class="container" id="dataContainer">
				<div class="section" id="content">


				</div>
			</div>
		</div>
	</div>
	 <%@include file="/before/include/footer.jsp"%>

	 <%--<%@include file="/before/include/script.html"%>--%>
<script src="/static/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
	function getVideo(id){
		window.location='/before/video/beforeVideoIndex.jsp?id='+id;
	}
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
	$(function () {
		$("#images").css("background-image","url('/static/img/banner-"+GetQueryString("id")+".jpg')");
		$.ajax({
			url:"/course/findBySubject/"+GetQueryString("id"),
			type:"GET",
			success:function (data) {
				$("#navDiv").text("公开课 / "+data.data[2].subjectName);
				$.each(data.data[0],function (index,obj) {



					$("#content").append("<div class=\"classifyName\"><p class=\"title title-first\">"+obj.courseTitle+"</p></div><div class=\"kcIntro\"><p class=\"int\"><span>课程介绍："+obj.courseDesc+"</span>" +
					"</p></div><ul id = 'video"+index+"'></ul>");
					$.each(data.data[1],function (ind,video) {
					    console.log(obj.id +" | "+ video.courseId);
                        if(video.courseId == obj.id||video.courseId === obj.id){
                        $("#video"+index).append("<li class=\"section-main\" onclick=\"return getVideo("+video.id+")\"><div class=\"thum\" style=\"background-image: url("+video.imageUrl+")\"></div>" +
                                "<p>"+video.title+"</p><div class=\"classify-v-info\"><span class=\"count\" title=\"观看次数\"><img src=\"/static/img/count.png\" alt=\"\">"+video.playNum+"</span>" +
                                "<span class=\"duration\" title=\"视频时长\"><img src=\"/static/img/player.png\" alt=\"\">"+video.time+"</span></div></li>");
                        }

                    })
                })
				console.log(data.data);
            }
		})
    });
    $.load(function () {
        let email = "${user.email}";
        if(email != null & email !== ""){
            $("#userBlock").css("display","inline-block");
            $("#regBlock").css("display","none");
        }
    })
</script>


</body>

</html>